package oo3;

import java.util.Scanner;

public class PiccTest {

	public static void main(String[] args) {
		PICC p = new PICC();
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入新业务员的姓名:");
		p.name = sc.next();
		System.out.println("电话：");
		p.tele = sc.next();
		int ch = 0;
		while (true) {
			System.out.println("1:录入新客户。2:查看.3：查找客户。4：修改客户信息。9:退出！");
			ch = sc.nextInt();
			switch (ch) {
			case 1:
				String tempName = sc.next();
				p.addNewCustomer(tempName);

				break;
			case 2:
				p.showNames();
				break;
			case 3:
				System.out.println("请输入要查找的名字：");
				// String search=sc.next();
				boolean isIn = p.search(sc.next());
				System.out.println(isIn ? "在" : "不在！");
				break;
			case 4:
				System.out.println("老名字：");
				String oldName = sc.next();
				System.out.println("新名字：");
				String newName = sc.next();
				boolean updateOk = p.modifyName(oldName, newName);
				if (updateOk) {
					System.out.println("修改成功");
				} else {
					System.out.println("修改失败！");
				}
				break;
			case 9:
				return;
			}
		}
	}

}
